﻿using Sai.Core.Introspection;

namespace Sai.Test.TestDataBuilders
{
    public class TypeNameBuilder
    {
        private Name Name { get; set; }
        private Namespace NamespaceName { get; set; }

        public static TypeNameBuilder Type()
        {
            return new TypeNameBuilder();
        }

        public TypeNameBuilder Named(string name)
        {
            this.Name = new Name(name);
            return this;
        }

        public TypeNameBuilder InNamespace(string ns)
        {
            this.NamespaceName = new Namespace(ns);
            return this;
        }

        public TypeName Build()
        {
            if (this.NamespaceName == null)
                this.NamespaceName = new Namespace();

            return new TypeName(this.NamespaceName, this.Name);
        }
    }
}
